import request from '../../../utils/request'

export function postPaginationListApi(page_size, current_page) {
  /**
   * 指定分页信息查询职位列表接口
  */
  return request({
    url: '/api/admins/post/?page_size=' + page_size + '&current_page=' + current_page,
    method: 'GET',
  })
}

export function postSearchPaginationListApi(page_size, current_page, search_date) {
  /**
   * 指定分页信息查询职位列表接口
  */
  return request({
    url: '/api/admins/post/?page_size=' + page_size + '&current_page=' + current_page + '&search_data=' + search_date,
    method: 'GET',
  })
}

export function postSearchApi(search_data) {
  /**
   * 指定查询内容获取职位接口
  */
  return request({
    url: '/api/admins/post/?search_data=' + search_data,
    method: 'GET',
  })
}

export function postListApi() {
  /**
   * 职位列表接口
  */
  return request({
    url: '/api/admins/post/',
    method: 'GET',
  })
}

export function postCreateApi(data) {
  /**
   * 职位创建接口
  */
  return request({
    url: '/api/admins/post/',
    method: 'POST',
    data: data,
  })
}


export function postDeleteApi (data) {
  /**
   * 职位删除接口
  */
  return request({
    url: '/api/admins/post/' + data['id'] + '/',
    method: 'DELETE',
  })
}

export function postUpdateApi (data) {
  /**
   * 职位更新接口
  */
  return request({
    url: '/api/admins/post/' + data['id'] + '/',
    method: 'PATCH',
    data: data
  })
}

export function postDetailApi (data) {
  /**
   * 单个职位接口
  */
  return request({
    url: '/api/admins/post/' + data['id'] + '/',
    method: 'GET',
  })
}
